<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <title>2.字符串包含指定字符</title>
  </head>
  <body>
    <script type="text/javascript" >
        let str = 'abc'

        const index1 = str.indexOf('a')
        const result = str.includes('b')

        console.log(result)
    </script>
  </body>
</html>